<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>股票管理</title>
<%@include file="../static/include/head.jsp"%>

<script src="<%=request.getContextPath()%>/static/assets/global/scripts/metronic.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/assets/admin/layout/scripts/layout.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/assets/admin/layout/scripts/quick-sidebar.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/assets/admin/layout/scripts/demo.js" type="text/javascript"></script>

<link href="<%=request.getContextPath()%>/static/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/static/assets/global/plugins/datatables/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/static/assets/global/plugins/datatables/plugins/bootstrap/dataTables.bootstrap.js" type="text/javascript"></script>

<link href="<%=request.getContextPath()%>/static/assets/global/plugins/bootstrap-datepicker/css/datepicker.css" rel="stylesheet" type="text/css" />
<script src="<%=request.getContextPath()%>/static/assets/global/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js" type="text/javascript"></script>

<script>
	jQuery(document).ready(function() {
		Metronic.init();
		Layout.init();
		QuickSidebar.init();
		Demo.init();
		$("#serchButton").click(function() {
			tableStockInit.fnDraw();
		});
		
		$('.date-picker').datepicker({
			language : 'cn',
			todayBtn : false,
			autoclose : true,
			forceParse : true,
			format : "yyyy-mm-dd"
		});
			
		var tableStockInit = $("#table_stock").dataTable({
				"paging" : true, //翻页功能
				"lengthChange" : true, //改变每页显示数据数量
				"searching" : false, //过滤功能
				"ordering" : true, //排序功能
				"order" : [ [ 0, "desc" ] ],
				"processing" : false,
				"serverSide" : true, //服务器数据
				"lengthMenu" : [ 10, 15, 30, 50 ],
				"pageLength" : 10,
				"language" : {
				"processing" : "努力加载中...",
				"search" : "搜索&nbsp;:",
				"lengthMenu" : "一页显示 _MENU_ 条数据",
				"info" : "当前第 _START_ 条到第 _END_ 条记录，共 _TOTAL_ 条记录",
				"loadingRecords" : "正在努力的加载数据...",
				"infoEmpty" : "当前第 0 条到第 0 条记录，共 0 条记录",
				"emptyTable" : "没有找到您查询的数据信息"
			},
			"ajax" : {
				"url" : "getAccountPage",
				"type" : "POST",
				"data" : function(data) {
					if(typeof($("#userName").val()) == "undefined"){
						data.userName = '${sessionScope.username}';
					}else{
						data.userName = $("#userName").val();
					}
					data.year = $("#years").val();
				}
			},
			"columns" : [{
					"data" : "userName"
				},{
					"data" : "value"
				},{
					"data" : "payCash"
				},{
					"data" : "cash"
				},{
					"data" : "freeCash"
				},{
					"data" : "beginCash"
				},{
					"data" : "totalValue"
				},{
					"data" : "cangWei"
				},{
					"data" : "floatProfit"
				},{
					"data" : "profit"
				},{
					"data" : "earningRate"
				}]
		});
	});
	
 	
	
</script>
</head>
<body class="page-header-fixed page-quick-sidebar-over-content">
	<%@include file="../static/include/header.jsp"%>
	<div class="clearfix"></div>
	<div class="page-container">
		<%@include file="../static/include/sidebar.jsp"%>
		<!-- BEGIN CONTENT -->
		<div class="page-content-wrapper">
			<div class="page-content">
				<!-- BEGIN STYLE CUSTOMIZER -->
				<%@include file="../static/include/styles.jsp"%>
				<!-- END STYLE CUSTOMIZER -->
				<div class="row">
					<div class="col-md-12">
						<!-- BEGIN PAGE HEADER-->
						<h3 class="page-title">
							账户统计管理 <small>账户条目一览</small>
						</h3>
						<div class="page-bar">
							<ul class="page-breadcrumb">
								<li><i class="fa fa-home"></i> <a href="index">主页</a> <i class="fa fa-angle-right"></i></li>
								<li><a href="stockManager">账户统计管理</a></li>
							</ul>
						</div>
						<!-- END PAGE HEADER-->
						<!-- BEGIN ROW -->
						<div class="portlet box blue-madison">
							<div class="portlet-title">
								<div class="caption">
									<i class="fa fa-user"></i>账户统计
								</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
								</div>
							</div>
							<div class="portlet-body">
								<div>
									<ul class="nav nav-tabs">
										<shiro:hasRole name="admin">
											<li style="float: right; margin-left: 5px">
												<button id="serchButton" type="button" class="btn green">搜索</button>
											</li>
											<li style="float: right"><input id="userName" type="text" class="form-control" value=""/></li>
										</shiro:hasRole>
										<li style="float: right">
											<select class="form-control" id="years">
												<option value="" selected="selected">请选择</option>  
												<option value="2015">2015</option>
												<option value="2016">2016</option>
												<option value="2017">2017</option>
												<option value="2018">2018</option>
												<option value="2019">2019</option>
											</select>
										</li>
									</ul>
									<div class="tab-pane fade active in" id="tab_1_1">
										<table id="table_stock" class="table table-striped table-hover table-bordered">
											<thead>
												<tr>
													<th>用户名</th>
													<th>持仓股市值</th>
													<th>投入金额</th>
													<th>卖出金额</th>
													<th>可用现金</th>
													<th>交易参考总资产</th>
													<th>总资产</th>
													<th>仓位</th>
													<th>浮动盈亏</th>
													<th>总盈亏</th>
													<th>名义投资收益率</th>
												</tr>
											</thead>
											<tbody>
											</tbody>
										</table>
									</div>
								</div>
							</div>
						</div>
						<!-- END ROW -->
					</div>
				</div>
			</div>
			<!-- END CONTENT -->
		</div>
	</div>
	<%@include file="../static/include/footer.jsp"%>
	
</body>
</html>
